/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication1;

/**
 *
 * @author user
 */
public class bai10 {
    public static void main(String[] args) {
        System.out.println(USCLN(7, 8));
    }
    
    private static int USCLN(int a,int b){
        if(a>b){
            if(a%b==0) return b;
            else
                return USCLN(b, a%b);
        } else
            if(b%a==0) return a;
            else return USCLN(a, b%a);
        
    }
}
